package edu.bw.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.TransactionManager;

import javax.sql.DataSource;

@Configuration
public class TransactionConfig {
    /*   <bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager" id="transactionManager">
           <constructor-arg name="dataSource" ref="dataSource"/>
       </bean>*/
    @Bean("transactionManager")
    public TransactionManager initTransactionManager(DataSource dataSource) {
        return new DataSourceTransactionManager(dataSource);
    }
}
